<?php
/**
 * 分类
 */
class System_Controller extends Base_Controller {
	public function __construct() {
		parent::__construct();
	}
	
	public function index() {
		$this->_show();
		$this->output->display($this->template);
	}
	
	public function makeHtml() {
		if (!Wee::$config['url_html_system']) {
			return;	
		}
		$this->page = $this->input->getIntval('p');	
		$this->_show();
		$this->output->makeHtml($this->template, load_model('System')->getPath($this->item, $this->page));
	}
//图图系统	
	private function _show() {
		$modSystem = load_model('System');
		$this->eng_name = Ext_Filter::sqlChars($this->input->getTrim('ename'));
		
		if ($this->eng_name) {
			$this->id = $modSystem->getId($this->eng_name);
		} else {
			$this->id = $this->input->getIntval('id');
		}

		$modTag  = load_model('Tag');
		$this->item = $modSystem->getPlace($this->id);
		if ($this->item === false) {
			$modTag->tutu_header("Location: ./\n");
			exit;
		}
		
		$this->template = 'system.dwt';
		$this->output->set('url', $this->item['url']);
		$this->output->set('system', $this->item);
		$this->output->set('id', $this->item['id']);
		$this->assignData();
	}
}